1. Field of the Invention
The present invention relates to a texture filtering apparatus, a texture mapping apparatus, and a method and program therefor which belong to a high-quality texture mapping technique in the three-dimensional computer graphics (CG) field.
2. Description of the Related Art
Recent rapid advances in three-dimensional computer graphics (CG) technology make it possible to implement realistic graphics rendering which looks like a real-life picture. However, many high-quality CG images for movies and TV programs are created by laborious manual work by content creators over an extended period. Such work involves enormous cost. It is likely that a wider variety of CG rendering will be required in the future. There is therefore a need to easily create high-quality CG images at lower cost.
As a technique for realistically rendering the texture of the surface of a CG model, a texture mapping technique is available. This is a technique of pasting a real-life image or an image drawn by a creator on the surface of a CG model on the basis of the texture coordinates assigned to CG data. This technique is widely used for CG creation.
If, however, texture mapping processing is simply applied to CG models which are placed at various positions in a three-dimensional space and have various shapes, some resultant CG model may have a mosaic pattern which causes a sense of oddness. This is because one pixel of a CG drawn frame does not always correspond one-to-one to a single pixel (also called a texel) of a texture depending on the depth of a CG model, its gradient with respect to a viewpoint, and the like. For this reason, there has been developed a technique of performing mapping upon performing texture filtering in accordance with the depth of a CG model, its gradient with respect to a viewpoint, and the like.
As typical texture filtering methods, bilinear filtering, trilinear filtering, anisotropic filtering, and the like are available. Bilinear filtering is a technique of determining a final pixel value (color) by extracting four neighboring pixels on the basis of texture coordinates designated by a decimal number and performing linear interpolation. Trilinear filtering is a technique of determining a final pixel value (color) by extracting eight proper pixels using a so-called MIP-Map texture and performing linear interpolation. In this case, a MIP-Map texture is a set of textures obtained by multiplying a texture to be mapped by ¼ stepwise. The respective textures are sequentially called “a texture at MIP-Map level 0, a texture at MIP-Map level 1, a texture at MIP-Map level 2, . . . ”. According to trilinear filtering, a texture to be used for mapping is changed in accordance with the depth of a CG model. If, for example, textures at MIP-Map levels 0 and 1 are to be used, bilinear filtering is performed by using each texture. In addition, linear interpolation is performed between the textures at the two levels. Anisotropic filtering is a technique of calculating a quadrilateral in a texture to be mapped to a pixel of a CG model in accordance with the gradient of the CG model with respect to a viewpoint, and performing linear interpolation by performing bilinear filtering or trilinear filtering at a plurality of sampling points in the quadrilateral, thereby determining a final pixel value (color). Using the above texture filtering makes it possible to express the surface of a CG model without any sense of oddness even if the CG model is enlarged/reduced or deformed (see, for example, JP-A 2004-272580 (KOKAI) and Jon P. Ewins, Marcus D. Waller, Martin White, and Paul F. Lister, “MIP-Map Level Selection for Texture Mapping”, IEEE Transactions on Visualization and Computer Graphics, v.4 n.4, pp. 317-329, October 1998).
There is also available a technique of mapping on the surface of a CG model in a wide range by generating a texture with an arbitrary size from a small sized texture. This is called a texture generating technique. As texture generating algorithms, there are available a method of generating a texture with an arbitrary size by performing pattern matching on a pixel or block basis and a method of expressing a large texture by preparing a plurality of small images with inconspicuous boundaries and randomly arranging them in a tile pattern (see, for example, JP-A 2004-272580 (KOKAI)). A texture generated by such a method is sometimes expressed by simply making each pixel have color information, and is expressed at other times by index images and codebooks (color tables). The latter technique has the merit of reducing the amount of texture data used by storing, in a codebook, color information which is repeatedly used, and expressing an address in the codebook at which color information to be used is stored by using an index.
As high-quality texture expression methods, high-dimensional texture techniques (see, for example, JP-A 2006-146326 (KOKAI)) are available. These techniques use textures captured under different viewpoint conditions or light source conditions and adaptively perform mapping on the basis of viewpoint conditions or light source conditions for a CG model.
The above description is about the background art associated with texture mapping for realistically expressing CG surfaces. It is, however, difficult to perform texture filtering for data obtained by generating a texture or high-dimensional texture. This is because it is impossible to simply generate a MIP-Map or quickly extract a plurality of pixels from texture data expressed by index images and codebooks. It is therefore necessary to develop a filtering method suitable for textures expressed by index images and codebooks and a filtering method specialized for a high-dimensional texture technique.
It is possible to implement texture mapping with a small data size in a wide range by generating one or more textures with arbitrary sizes from one or more textures acquired under different viewpoint conditions or light source conditions. In this case, however, texture filtering cannot be simply performed.
In order to simply perform texture filtering, it is necessary to convert a texture into a general texture data structure instead of an expression using index images and codebooks. This conversion, however, cancels the merit of reducing a data amount by texture generation. There is also available a method of generating a MIP-Map for each tile and painting out only the boundary portions between the tiles in the same color. This method also suffers from a problem in terms of resolution.